package com.magic.gre.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.magic.gre.R;
import com.magic.gre.adapter.TypeAdapter;
import com.magic.gre.base.activity.BaseCenterActivity;
import com.noname.lib_base_java.util.StatusBarUtil;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Author: Lmoumou
 * Date: 2019-01-14 12:20
 * 文件名: TestActivity
 * 描述:
 */
public class TestActivity extends BaseCenterActivity {

    @BindView(R.id.status_bar_v)
    View statusView;

    public static void startThis(Context context) {
        Intent intent = new Intent(context.getApplicationContext(), TestActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected boolean isImmerse() {
        return true;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_test;
    }

    @Override
    protected void initView(@Nullable Bundle savedInstanceState) {

        StatusBarUtil.setHeight(this, statusView);

        RecyclerView commentList = findViewById(R.id.comment_list);
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 2; i++) {
            list.add(i + 1 + "");
        }
        TypeAdapter adapter = new TypeAdapter(this, list);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        commentList.setLayoutManager(layoutManager);
        commentList.setAdapter(adapter);
    }
}
